//
//  Instances.h
//
//  Created by Rune Laugesen on 23/01/12.
//  Copyright 2012 Copenhagen University. All rights reserved.
//

#ifndef Dictionary_Instances_h
#define Dictionary_Instances_h

#include <string>
#include <vector>
#include <map>

using namespace std;

typedef vector< map<string,double> > FeatureArray;

struct Instance
{
    // Wieght of the word
    double weight;
    
    // Array of map containing occurance of attributes for each feature
    FeatureArray features;
};

typedef map<string, vector<string> > FeatureMap;
typedef map<string, Instance> InstanceMap;
typedef vector< vector<string> > InstanceList;
typedef vector<string> StringList;
typedef vector< pair<string, double> > WeightedStringList;

enum features
{
    WORD,
    POS,
    LEMMA,
    NER,
    CLUSTER100,
    CLUSTER1000,
    TOPIC
};


class Instances
{
public:
    // List of instances
    InstanceMap instances;
    
    // Number of instances
    int n;
    
    // Feature count to test in classifier
    int featurecount;
    
    // TODO: write logic to make statistics on instances

    features StringToFeature(string s)
    {
        if (s == "POS") {
            return POS;
        }
        if (s == "LEMMA") {
            return LEMMA;
        }
        if (s == "NER") {
            return NER;
        }
        if (s == "CLUSTER100") {
            return CLUSTER100;
        }
        if (s == "CLUSTER1000") {
            return CLUSTER1000;
        }
        if (s == "TOPIC") {
            return TOPIC;
        }
        return POS;
    };
};

#endif
